/*
 Navicat Premium Data Transfer

 Source Server         : wangjun
 Source Server Type    : MySQL
 Source Server Version : 50619
 Source Host           : localhost
 Source Database       : qingmu

 Target Server Type    : MySQL
 Target Server Version : 50619
 File Encoding         : utf-8

 Date: 11/25/2015 22:19:13 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `qm_notification`
-- ----------------------------
DROP TABLE IF EXISTS `qm_notification`;
CREATE TABLE `qm_notification` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  `sender_uid` int(11) DEFAULT NULL COMMENT '发送者ID',
  `recipient_uid` int(11) DEFAULT '0' COMMENT '接收者ID',
  `action_type` tinyint(1) DEFAULT '0' COMMENT '操作类型 0：普通消息，1：系统通知',
  `source_id` varchar(16) NOT NULL DEFAULT '0' COMMENT '关联 ID',
  `read_flag` tinyint(1) DEFAULT '0' COMMENT '阅读状态',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `sender_recipient_uid` (`sender_uid`,`recipient_uid`) USING BTREE,
  KEY `recipient_read_flag` (`recipient_uid`,`read_flag`),
  KEY `source_id` (`source_id`),
  KEY `action_type` (`action_type`),
  KEY `created_at` (`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='系统通知';

-- ----------------------------
--  Records of `qm_notification`
-- ----------------------------
BEGIN;
INSERT INTO `qm_notification` VALUES ('1', '1', '4', null, '0', '0', '2015-11-25 11:03:41', '2015-11-25 11:03:43'), ('2', '1', '3', null, '0', '0', '2015-11-25 11:03:47', '2015-11-25 11:03:49');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
